class Animal:
    def __init__(self, name, age):
        self.name = name
        self.age = age
    def speak(self):
        print(f"{self.name} 发出叫声")
dog = Animal("小狗", 3)
dog.speak()
